package com.hfy.shop.controller;

import com.hfy.model.dto.pay.PayOrderDto;
import com.hfy.shop.service.PayService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.Parameters;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import result.Result;

/**
 * @ author 韩
 * time: 2024/9/11 16:46
 */

@RestController
@RequestMapping("/pay")
@Tag(name = "支付控制器" ,description = "处于支付->订单->商品的最高层模块")
public class PayController {

    @Autowired
    private PayService payService;


    @PostMapping("/order")
    @Operation(summary = "支付订单",description = "根据订单ID去支付")
    @Parameters({@Parameter(name = "orderId",description = "订单ID"),
    })
    public Result payOrder(@RequestBody PayOrderDto dto) {
        return payService.payOrder(dto);
    }
}
